package com.neusoft.yuejian_01.activity;

import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

import com.neusoft.yuejian_01.R;
import com.neusoft.yuejian_01.base.BaseActivity;
import com.neusoft.yuejian_01.fragment.MainFragment;
import com.neusoft.yuejian_01.fragment.TrainFragment;

public class MainActivity extends BaseActivity {

    private FragmentManager fragmentManager;
    private FragmentTransaction transaction;
    private MainFragment mainFragment;
    private TrainFragment trainFragment;
    private final int mode = MODE_PRIVATE;


    @Override
    protected void initView() {
        setContentView(R.layout.activity_main);
        fragmentManager = getSupportFragmentManager();
        showMainFragment();
    }

    @Override
    protected void initEvents() {

    }

    @Override
    protected void initData() {

    }

    private void showMainFragment() {
        transaction = fragmentManager.beginTransaction();
        mainFragment = new MainFragment();
        transaction.add(R.id.fragment_holder, mainFragment);
        transaction.commit();
    }

    @Override
    protected void onResume() {
        super.onResume();
        mainFragment.updata();
    }


}
